Dynomotion

Group: DynoMotion Message: 9377 From: lovethebuzz69 Date: 4/7/2014
Subject: KFLOP and Kanalog servo tuning.
Hi Tom,
I have been working on installing some Yaskawa 450W AC servo motors on my 4 axis mill in combination with Kflop, Kanalog, and Mach3.
Attached are the move plots as well as the configuration and filters.
You may notice that I am not using channel 0. For some reason that channel does not work. Any time I connect the amplifier to it the motor runs uncontrollably. But, not an issue right now.
I have followed these steps you outlined on another forum and have been very helpful.
#1 Check that the DAC can command Velocity to the Motor/Amplifier
#2 Check the Encoder Feedback is working properly
#3 Enable the axis and check that it servos
#4 Perform a Move on the Step Response Screen to check the Response
#5 Servo Tuning

I have been working on the tuning for some time (as you would guess) and I think I am pretty close. But when I use KmotionCNC and make some manual moves like G0X.030 the axis comes up short of the desired position by about .001 every time, and I am not sure why. Is that because my tuning is not "perfect" (how close does it need to be?).
Based on the plots and Configs can you make some suggestions on how to get closer? I have been using .3 secs and counts of 8192 for the "Moves" in the Step Response window, are these reasonable numbers?

The encoders integral to the motors and are 8192 counts per revolution. The motor is attached to each axis via a timing belt reduction of 2.16667:1 and the ball screws are .2" per revolution. So, I calculated 88746.66667 counts per inch (8192*2.16667*5). This is the value I used in the setup of the KmotionCNC. Does that seem to be correct?

Additionally, I set up the plugin for Mach3 but I can't seem to get Mach out of E-stop. I have not step any out the IO on the Kanalog so there are no limit switches connected (yes, I am living dangerously). Mach shows no bits active on the diagnostic screen. So the emergency condition must be coming from the kflop. Any guesses as to what bits are triggering the e-stop?

Thanks for your help in advance.
Rick
  @@attachment@@
Group: DynoMotion Message: 9378 From: Tom Kerekes Date: 4/7/2014
Subject: Re: KFLOP and Kanalog servo tuning. [7 Attachments]
Hi Rick,

Regarding:

"short by 0.001" - There can be many reasons for this.  Mechanical backlash, scale factor, loss of encoder counts, servo tuning, ...  By making some observations you can usually narrow it down easily.  Does it accumulate?  Is it proportional to distance moved?  What is the difference between the Commanded Destination and measured Position on the KMotion Axis Screen?

"88746.66667 counts per inch (8192*2.16667*5)" seems correct to me.   Could the encoder really be 8000 counts/rev?  That would result in being short 0.0007 for a 0.030 move.  Make a large (ie. 10 inch) move to test.

Mach3 will not allow you to disable the EStop input.  It must be set to something.  Set it to dummy port 0 pin 0 and active high so it will never be active.

Your Max Velocity is way too high.  Your velocity for your small test move is reasonable (DAC goes to about 25% and velocity is ~ 120,000 counts/sec) but if you made a large move the velocity would attempt to go to 4,000,000.  Find your Max Velocity Setting based on testing a move large enough to accelerate to your Max Velocity and not be limited by acceleration or Jerk.  It will probably be around 500,000 counts/sec.

Your Acceleration may be too high also.  Acceleration/Jerk = 4/9 =  0.44 sec  With your settings it would take 0.44 sec to reach full acceleration.  But your move size only gives time to ramp the acceleration up for ~ 0.05 secs.

Your 2nd Order low pass filter at 100Hz is probably at too low of frequency.  Use 500 Hz or higher.

Consider adding I gain to reduce error.  Start with 0.0001 and increase until the system goes unstable.  Then back down by a factor of 2 or so.

HTH
Regards
TK

Group: DynoMotion Message: 9379 From: az@aimele.com Date: 4/7/2014
Subject: Re: KFLOP and Kanalog servo tuning. [7 Attachments]

Hello This is AZ.

I was interested in your issue so I'm chiming in.
I'm assuming you mean that your position displayed is .001 inches from your position commanded.
With very reasonable gains and your motor resolution you should be easily able to achieve .0001 inch final position error.
You may need to adjust the analog offset in the drives or the Kanalog to match each other. Simply adjust one or the other until your final position is "Dead Nuts" 
Adding some" I" gain would solve your final position problem but when machining you want the motors to follow the command as closely as possible because once that chip is cut, it's gone.

AZ 


Group: DynoMotion Message: 9386 From: lovethebuzz69 Date: 4/9/2014
Subject: Re: KFLOP and Kanalog servo tuning. [7 Attachments]
Thanks Tom,
It does not seem to be proportional to the distance moved. no matter how far I moved the error is always the same. It returns to the zero point dead on. The Axis screen shows the Dest and Postion counts to be the exact number of counts need to get to the destination from the starting point. I did notice that sending a Zero1 from the console I never get a zero count. It always moves to a negative 24 counts. In fact when the axis are disabled in the Axis screen both axis drift in the negative direction. Measuring the voltage across DAC 1 (on JP11) to ground shows -41.08 mv with the axis enabled. It drops to -21.2mv with the axis disabled and the axis starts to drift. I sm starting to think several variables are coming into play. I only have a couple of hours a night to work on it so progress seems slow. I did set the the acceleration to some more reasonable numbers.

Thanks
Rick
Group: DynoMotion Message: 9387 From: lovethebuzz69 Date: 4/9/2014
Subject: Re: KFLOP and Kanalog servo tuning. [7 Attachments]
Thanks Az,
Its a work in progress.
I think there is some offset error. The motor drivers have the capability to automatically adjust for the reference offset. But that does not seem to help.
I am getting frustrated and I feel I need to start over. Things seem to be getting further from where I started. I am still not sure if my tuning is close or not.

I much appreciate the input.

Thanks

Rick
Group: DynoMotion Message: 9388 From: Tom Kerekes Date: 4/9/2014
Subject: Re: KFLOP and Kanalog servo tuning.
Hi Rick,

I wouldn't start over.  Analyze what is going on.  Try and enjoy the journey :}

Yes I think you have an offset.  Analog (unlike digital) is inherently imperfect.  But it doesn't have to be perfect.  I'm sure Kanalog has some offset and your amplifier has some offset.  There is also always some noise on analog signals.  Here is what happens with only Proportional Gain.  When you "Zero" the commanded and Encoder position are set to zero.  Everything is perfect and there is zero error and zero DAC output.  But because there is some offset the motor starts to drift.  As the motor drifts away this will cause an error to grow.  The DAC signal will grow proportionally to the error.  Eventually the error and DAC signal will grow to the point that exactly compensates for any offset.  At this point the motor will stop.  So a static condition will result with some small error that causes the offset to be compensated.

(I) Integrator Gain solves this problem.   It accumulates errors and makes a correction based on the sum of errors.  So if a small error persists it will accumulate and make a bigger and bigger correction untill eventually the error is driven to zero.

Try adding some I gain like I suggested before.  Start with small values like 0.0001.  The values are small because they accumulate 11,111 times per second (90us).

It sounds like you might have a backlash problem as well.  Try moving to some position from opposite directions and see if you see a difference.

Regards
TK


Group: DynoMotion Message: 9389 From: AZ@AIMELE.COM Date: 4/10/2014
Subject: Re: KFLOP and Kanalog servo tuning.
Hello,  
I'm not sure about how the Yaskawa drives compensate for the analog offset What  I usually do in these situations is pull your motor off the machine so you can see the motor shaft. Tighten a tie wrap to the motor shaft with the tail still on it.  You may want to shorten the tail to keep it from hitting anything as it spins.  Tape some masking tape to your motor face so you can mark the position of the tail at the beginning and the end of the moves.
You may want to change your system resolution so you're using either encoder counts or revolutions as your position units so you're sure there are no rounding errors.

After powering up the system and enable the motor and enabling the axis, command a ten revolution move in + direction. Now mark the position of the tail.  Go 10 more revs in the + dir and mark that ending point.  I'm going to guess the two marks will be the same.  Note the analog commmand voltage at the end of each move.

Now do the same but in the - direction two time marking each time and noting the analog voltage each time.
If everything is consistent all four tail positions will be the same.  However if the +direction end points are different from the - direction end points.  You may have a "deadband" parameter programmed into your drive to alleviate analog noise.

Do  the same thing again and try to rotate the shaft by hand at each stop point.  I'm guessing it will be rock steady and resisting motion in either direction.  If that is the case then you for sure have a deadband in your drives analog processing.  It may be programmable so you could minimize it to reduce the effect.  

Many digital drives with analog inputs now have an analog deadband and some are not programmable so you get what you get.
Many digital drives  operate  internally like a position controller because they monitor the encoder feedback and don't have a DC tach for velocity feedback like the pure analog servos had.  With an analog input the digital drive it will go precisely the commanded speed for that analog command value.  With zero V command it not only delivers zero speed, they also hold their position  even without an external position loop.
To prevent 0 speed jitter, there is an analog deadband where the drive simply ignores any voltage less than ...say .020 volts but it considers any voltage from 0 to 0.020 as zero speed so it hold the motor steady.  Unfortunately the CNC  control expects the motor to move even at .005 volts. so the error builds up until it gets high enough to cause rotation and the analog output stays at the voltage that first caused motion. This type of deadband will cause machining problems due to the lack of response at the low speeds. " I "gain will pull the motor into position at the end of the move.but it cannot correct the reversing error during machining.



Group: DynoMotion Message: 9397 From: sparky300013 Date: 4/10/2014
Subject: Re: KFLOP and Kanalog servo tuning.
Yaskawa sigma II and sigma V have a balance adjustment. FN-00A spd.  Set your axis to 0Volt output on the dac. watch the encoder count on the Kflop and adjust FN-00A until the encoder count is very minimal.  If the axis is disabled the drive should be disabled, that will prevent the drift until the axis is enabled again.